package com.sgb.zhaocai.entity;

import android.text.TextUtils;
import com.swgk.core.util.DateUtils;

import java.math.BigDecimal;

/**
 * Time:2021/7/2
 * AUTHOR:F_Q
 * Description:
 */
public class SubpackagePlanListEntity {

    private String id;
    private String projectId;
    private String businessPlanId;
    private String type;
    private String businessPlanItemizedRecordId;
    private String itemProject;
    private String unitProjectName;
    private String partitionedProjectName;
    private String itemMemo;
    private String projectAddressName;
    private String startDate;
    private String itemBusinessControlAmount;
    private String itemUnit;
    private boolean offerState;

    public String getBusinessPlanId() {
        return businessPlanId;
    }

    public void setBusinessPlanId(String businessPlanId) {
        this.businessPlanId = businessPlanId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getBusinessPlanItemizedRecordId() {
        return businessPlanItemizedRecordId;
    }

    public void setBusinessPlanItemizedRecordId(String businessPlanItemizedRecordId) {
        this.businessPlanItemizedRecordId = businessPlanItemizedRecordId;
    }

    public boolean getOfferState() {
        return offerState;
    }

    public void setOfferState(boolean offerState) {
        this.offerState = offerState;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getItemMemo() {
        if (!TextUtils.isEmpty(itemMemo)){
            return itemMemo;
        }else {
            return "/";
        }
    }

    public void setItemMemo(String itemMemo) {
        this.itemMemo = itemMemo;
    }

    public String getUnitProjectName() {
        return unitProjectName;
    }

    public void setUnitProjectName(String unitProjectName) {
        this.unitProjectName = unitProjectName;
    }

    public String getItemBusinessControlAmount() {
        if (!TextUtils.isEmpty(itemBusinessControlAmount)){
            BigDecimal big = new BigDecimal(itemBusinessControlAmount);
            big = big.stripTrailingZeros();
            return big.toPlainString();
        }else {
            return "";
        }
    }

    public void setItemBusinessControlAmount(String itemBusinessControlAmount) {
        this.itemBusinessControlAmount = itemBusinessControlAmount;
    }

    public String getItemUnit() {
        if (!TextUtils.isEmpty(itemUnit)){
            return itemUnit;
        }else {
            return "";
        }
    }

    public void setItemUnit(String itemUnit) {
        this.itemUnit = itemUnit;
    }

    public String getItemProject() {
        return itemProject;
    }

    public void setItemProject(String itemProject) {
        this.itemProject = itemProject;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getPartitionedProjectName() {
        return partitionedProjectName;
    }

    public void setPartitionedProjectName(String partitionedProjectName) {
        this.partitionedProjectName = partitionedProjectName;
    }

    public String getProjectAddressName() {
        if (!TextUtils.isEmpty(projectAddressName)){
            String replace = projectAddressName.replace("/", "");
            return replace.replace(" ","");
        }else {
            return "";
        }
    }

    public void setProjectAddressName(String projectAddressName) {
        this.projectAddressName = projectAddressName;
    }

    public String getStartDate() {
        if (!TextUtils.isEmpty(startDate)){
            String timestamp = DateUtils.timestampToDate(Long.parseLong(startDate));
            return timestamp;
        }else {
            return "";
        }
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }
}
